<template>
  <div>
    <h2>我是妹妹,我开的是我姐的车{{car}}</h2>
  </div>
</template>

<script>
import PubSub from "pubsub-js";
export default {
  name: "Mei",
  data(){
    return {
      car:"mini"
    }
  },
  mounted(){
    // 一般来说都是在初始化的时候进行订阅
    PubSub.subscribe("getCar",this.getCar)
  },
  methods:{
    getCar(_,value){
      this.car = value
    }
  }
};
</script>

<style>

</style>
